<?php
/**
 * file created on 28-mag-2006
 * jaco_at_pixeldump_dot_org
 * some sample support code
 */

require_once("../config.inc.php");			              // let's start using mk

$imgDir = "../tmp/";

/**
 * generic
 * center html content [scriptname] in a web page
 */
function show_content($content = "", $scriptFN = ""){

	$str = "";                                                // will contain some content
	if(strlen($scriptFN)) $str .= "<h2>" .$scriptFN ."</h2>"; // write a title
	$str .= $content;                                         // complete content population

	$div = new MKDiv();                                       // bound in a layer
	$div->add_divAttrib("STYLE", "text-align:left");          // natural text flow
	$div->set_content($str);                                  //

	$sHtml = get_page_header();                               // prepare an html page header

	$tbl = new MKTable();                                     // new html table
	$tbl->add_tableAttrib("WIDTH", "100%");                   // populate with attribs ...
	$tbl->add_tableAttrib("HEIGHT", "100%");                  // ... full client area

	$tRow = array();                                          // prepare an array ...
	$tRow[0] = array();                                       // ... first "cell"
	$tRow[0]["cellContent"] = $div->fetch_html();             // ... populate cell
	$tRow[0]["cellAttribs"]["ALIGN"] = "center";              // center in cell
	$tRow[0]["cellAttribs"]["VALIGN"] = "middle";             // ...
	$tbl->add_row($tRow);

	$sHtml .= $tbl->fetch_html();                             // get almost the whole html content
	$sHtml .= "</body></html>";                               // close html tags

	return $sHtml;                                            // return to caller
}
?>
